<?php
	if(SETTING_CHECK_DB == 1)	// Auto create DB if not exists
	{
		$db_status = check_database_status(1);	// return $db_status
		
		if($db_status == 0)
		{
			$msg_result = "CREATE DATABASE : <br />";
			$result = 0;
			
			$msg_result .= "<table border='0' cellpadding='0' cellspacing='0'><tr><th style='width:30px;'></th><th></th><th></th><th></th></tr>";
			
			$chknum = 1; $chkname = DB_NAME;
			$result = check_database($chknum); $msg_result .= "<tr><td>#".$chknum."</td><td>&nbsp;:&nbsp;</td>";if($result == 1){$msg_result .= "<td>".$chkname." </td><td><span style='color:green;'>&nbsp;SUCCESS&nbsp;</span></td>";}else{$msg_result .= "<td><span style='color:red;'>FAILED</span></td>";}$msg_result .= "</tr>";
			
			$msg_result .= "</table>";
			echo $msg_result;
			
		}
		else
		{
			echo "<span style='color:red;'>CREATE DATABASE FAILED !!</span>";
		}
	}
	else
	{
		echo "<span style='color:red;'>ERROR CANNOT CHECK DATABASE, DATABASE CHECK IS NOT ALLOWED !!</span>";
	}
?>